/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pkl53.view;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Frame;
import javax.swing.JFrame;
import javax.swing.JPanel;
import pkl53.controller.CardLayoutController;
import pkl53.controller.LoginController;


/**
 *
 * @author User
 */
public class MainFrame extends javax.swing.JFrame {

    
    private LoginController loginController;
   private CardLayout cardController;
    
    /**
     * Creates new form mainFrame
     */
    public MainFrame() {
        initComponents();
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        this.setLocationRelativeTo(this);
        cardController = (CardLayout) this.getMainPanel().getLayout();
        homePanel1.setmainFrame(this, mainPanel, cardController);
        dataEntriPanel1.setmainFrame(mainPanel);
        dataEntriUsahaPanel1.setmainFrame(mainPanel);
        updatePanel1.setMainFrame(mainPanel,this);
        
    }
    
    public static JPanel getMainPanel() {
        return mainPanel;
    }

    public LoginPanel getLoginPanel() {
        return this.loginPanel1;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        b1coba1 = new pkl53.model.B1coba();
        blok5678coba1 = new pkl53.model.Blok5678coba();
        b5coba1 = new pkl53.model.B5coba();
        mainPanel = new javax.swing.JPanel();
        loginPanel1 = new pkl53.view.LoginPanel();
        updatePanel1 = new pkl53.view.UpdatePanel();
        dataEntriPanel1 = new pkl53.view.DataEntriPekerjaanPanel();
        homePanel1 = new pkl53.view.HomePanel();
        dataEntriUsahaPanel1 = new pkl53.view.DataEntriUsahaPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        mainPanel.setLayout(new java.awt.CardLayout());
        mainPanel.add(loginPanel1, "loginPanel");
        mainPanel.add(updatePanel1, "updatePanel");
        mainPanel.add(dataEntriPanel1, "dataEntriPekerjaanPanel");
        mainPanel.add(homePanel1, "homePanel");
        mainPanel.add(dataEntriUsahaPanel1, "dataEntriUsahaPanel");

        getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private pkl53.model.B1coba b1coba1;
    private pkl53.model.B5coba b5coba1;
    private pkl53.model.Blok5678coba blok5678coba1;
    private pkl53.view.DataEntriPekerjaanPanel dataEntriPanel1;
    private pkl53.view.DataEntriUsahaPanel dataEntriUsahaPanel1;
    private pkl53.view.HomePanel homePanel1;
    private pkl53.view.LoginPanel loginPanel1;
    private static javax.swing.JPanel mainPanel;
    private pkl53.view.UpdatePanel updatePanel1;
    // End of variables declaration//GEN-END:variables


}
